#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtCharts/QBarCategoryAxis>
#include <QtCharts/QCandlestickSeries>
#include <QtCharts/QCandlestickSet>
#include <QtCharts/QChartView>
#include <QtCharts/QValueAxis>
#include <QDateTime>
#include <QMessageBox>
#include "config.h"
#include "dbutil.h"
QT_CHARTS_USE_NAMESPACE


struct StockData{
    double open;
    double close;
    double low;
    double high;
    qint64 time;
};

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    Config* config;
    DBUtil* dbUtil;
    void loadConfig();
    void showCandle(QList<QMap<QString,QVariant>> list);
    QList<StockData> processData(QList<QMap<QString,QVariant>> list);
};

#endif // MAINWINDOW_H
